package com.ruoyi.test;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.system.domain.SysLogininfor;
import com.ruoyi.system.mapper.SysDeptMapper;
import com.ruoyi.system.mapper.SysLogininforMapper;
import com.ruoyi.test.base.BaseTest;
import com.ruoyi.test.mapper.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)//junit4测试需要加这个注解
public class BootTest extends BaseTest {

    @Autowired
    SysLogininforMapper sysLogininforMapper;

    @Test
    public void test1() {
        IPage<SysLogininfor> page = new Page<>(1, 10);
        SysLogininfor param = new SysLogininfor();
        param.setUserName("admin");
        print(sysLogininforMapper.selectLogininforList(page, param));
    }

    @Autowired
    SysLogininfoMpMapper sysLogininfoMpMapper;

    @Test
    public void test2MpMapper() {
        print(sysLogininfoMpMapper.selectPage(new Page<>(1,5), Wrappers.emptyWrapper()));
    }

    @Autowired
    SysDeptMpMapper sysDeptMpMapper;

    @Test
    public void test3(){
        print(sysDeptMpMapper.selectPage(new Page<>(1,5), Wrappers.emptyWrapper()));
    }

    @Autowired
    SysDictDataMpMapper sysDictDataMpMapper;

    @Test
    public void test4(){
        print(sysDictDataMpMapper.selectPage(new Page<>(1,5), Wrappers.emptyWrapper()));
    }

    @Autowired
    SysDictTypeMpMapper sysDictTypeMpMapper;

    @Test
    public void test5(){
        print(sysDictTypeMpMapper.selectPage(new Page<>(1,5), Wrappers.emptyWrapper()));
    }

    @Autowired
    SysMenuMpMapper sysMenuMpMapper;

    @Test
    public void test6(){
        print(sysMenuMpMapper.selectPage(new Page<>(1,5), Wrappers.emptyWrapper()));
    }

    @Autowired
    SysRoleMpMapper sysRoleMpMapper;

    @Test
    public void test7(){
        print(sysRoleMpMapper.selectPage(new Page<>(1,5), Wrappers.emptyWrapper()));
    }

}
